package com.itlong.cloud.property.service;

import com.itlong.cloud.POJO.DTO.property.PropertyDeviceCloudControllerGetDTO;
import com.itlong.cloud.POJO.DTO.property.PropertyDeviceCloudControllerSaveDTO;
import com.itlong.cloud.POJO.VO.property.CloudControllerFloorInfoVO;
import com.itlong.cloud.POJO.VO.property.CloudControllerVO;
import com.itlong.cloud.POJO.VO.property.PropertyDeviceCloudControllerGetVO;
import com.itlong.cloud.utils.page.Page;

import com.itlong.cloud.POJO.VO.property.PropertyDeviceCloudControllerEleVO;

import java.util.List;

/**
 * <desc>
 *      云群控器业务处理接口
 * </desc>
 *
 * @createDate 2019/03/25
 */
public interface IDeviceCloudControllerService {
    /**
     * <desc>
     *      检测sn是否已存在
     * </desc>
     *
     * @param sn
     * @return
     * @author Jiaqi.X
     * @createDate 2019/03/25
     */
    Integer checkSnIsExists(String sn);

    /**
     * <desc>
     *      获取设备的状态
     * </desc>
     *
     * @param sn
     * @return
     * @author Jiaqi.X
     * @createDate 2019/03/25
     */
    Integer getDeviceStatus(String sn);

    /**
     * <desc>
     *      云控制器登录
     * </desc>
     *
     * @param sn
     * @param encryptionAbility
     * @return
     * @author Jiaqi.X
     * @createDate 2019/03/25
     */
    CloudControllerVO login(String sn,String encryptionAbility) throws Exception;

    /**
     * <desc>
     *      分页查询云群控器列表
     * </desc>
     *
     * @param propertyDeviceCloudControllerGetDTO 云群控器查询DTO
     * @return 分页结果
     * @author wangzhi
     * @createDate 2019/03/26
     */
    Page<PropertyDeviceCloudControllerGetVO> getPage(PropertyDeviceCloudControllerGetDTO propertyDeviceCloudControllerGetDTO) throws Exception;

    /**
     * <desc>
     *      通过token获取用户信息
     * </desc>
     *
     * @param token
     * @return
     * @author Qiang.S
     * @createDate 2019/03/27
     */
    CloudControllerVO retrieve(String token);

    /**
     * <desc>
     *      上报设备能力集
     * </desc>
     *
     * @param deviceUnique 设备唯一码
     * @param productKey 阿里云产品key
     * @param deviceProJs 设备属性
     * @author Qiang.S
     * @createDate 2019/03/28
     */
    void reportCapacitySet(String deviceUnique,String productKey,String deviceProJs) throws Exception;

    /**
     * <desc>
     *      更新云电梯缓存iot信息
     * </desc>
     *
     * @param cloudControllerVO
     * @return
     * @author Qiang.S
     * @createDate 2019/03/28
     */
    CloudControllerVO updateCloudClusterIotCacheInfo(CloudControllerVO cloudControllerVO) throws Exception;

    /**
     * <desc>
     *      查询单个云群控器
     * </desc>
     *
     * @param propertyDeviceCloudControllerGetDTO 云群控器查询DTO
     * @return 单个云群控器VO
     * @author wangzhi
     * @createDate 2019/03/27
     */
    PropertyDeviceCloudControllerGetVO getOne(PropertyDeviceCloudControllerGetDTO propertyDeviceCloudControllerGetDTO) throws Exception;

    /**
     * <desc>
     *      一键启用禁用设备
     * </desc>
     *
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2019/03/27
     */
    Integer setStatus(String projectId, String deviceUnique, Integer status) throws Exception;

    /**
     * <desc>
     *      获取云群控器可绑定的云电梯设备列表信息
     * </desc>
     *
     * @return 电梯设备列表信息
     * @author wangzhi
     * @createDate 2019/03/27
     */
    List<PropertyDeviceCloudControllerEleVO> getCloudElevatorList(PropertyDeviceCloudControllerGetDTO propertyDeviceCloudControllerGetDTO) throws Exception;

    /**
     * <desc>
     *      校验所选云电梯的楼层映射表
     * </desc>
     *
     * @return 0-楼层对应表不一致，1-楼层对应表一致
     * @author wangzhi
     * @createDate 2019/03/28
     */
    int checkElevatorFloorConfig(String deviceUniqueElevators) throws Exception;

    /**
     * <desc>
     *      校验所选云电梯的公共楼层是否一致
     * </desc>
     *
     * @return 0-不一致，1-一致
     * @author Juguang.S
     * @createDate 2020/06/10
     */
    int checkElevatorCommonFloorConfig(String deviceUniqueElevators) throws Exception;

    /**
     * <desc>
     *      同步楼层映射表
     * </desc>
     *
     * @return 0-失败，1-成功
     * @author wangzhi
     * @createDate 2019/03/28
     */
    Integer resetElevatorFloorConfig(PropertyDeviceCloudControllerSaveDTO propertyDeviceCloudControllerSaveDTO) throws Exception;

    /**
     * <desc>
     *      同步公共楼层
     * </desc>
     *
     * @return 0-失败，1-成功
     * @author Juguang.S
     * @createDate 2020/06/10
     */
    Integer resetElevatorCommonFloorConfig(PropertyDeviceCloudControllerSaveDTO propertyDeviceCloudControllerSaveDTO) throws Exception;

    /**
     * <desc>
     *      保存云群控器信息
     * </desc>
     *
     * @return 0-失败，1-成功
     * @author wangzhi
     * @createDate 2019/03/28
     */
    Integer save(PropertyDeviceCloudControllerSaveDTO propertyDeviceCloudControllerSaveDTO) throws Exception;

    /**
     * <desc>
     *      修改云群控器信息
     * </desc>
     *
     * @return 0-失败，1-成功
     * @author wangzhi
     * @createDate 2019/03/28
     */
    Integer update(PropertyDeviceCloudControllerSaveDTO propertyDeviceCloudControllerSaveDTO) throws Exception;

    /**
     * <desc>
     *      校验云群控器和云电梯是否正在执行预约，0否，1是
     * </desc>
     *
     * @return 0否，1是
     * @author wangzhi
     * @createDate 2019/05/06
     */
    Integer checkCloudCallStatus(PropertyDeviceCloudControllerSaveDTO propertyDeviceCloudControllerSaveDTO) throws Exception;

    /**
     * <desc>
     *      获取群控器设备详情
     * </desc>
     *
     * @param deviceUnique
     * @return
     * @author Jiaqi.X
     * @createDate 2019/08/13
     */
    CloudControllerFloorInfoVO getControllerFloorInfo(String deviceUnique);
}
